<?php

namespace Plu\Library\Services\Redis\Room;

use Plu\Library\Services\ServiceBase;

class ScreenshotsRedis extends ServiceBase {
    const KEY_OF_LIVE_SCREEN_PIC    = "live:screen:pic";

    const KEY_OF_LIVE_SCREEN_SQUARE = "live:screen:squarepic";

    const KEY_OF_USER_SCREEN_PIC    = "live:screen:user";

    const KEY_OF_USER_SCREEN_SQUARE = "live:screen:user:square";

    public function getAutoScreencap($roomId) {
        $redis = $this->getRedis("live");

        return $redis->hGet(self::KEY_OF_LIVE_SCREEN_PIC, $roomId);
    }

    public function getAutoScreencapSquare($roomId) {
        $redis = $this->getRedis("live");

        return $redis->hGet(self::KEY_OF_LIVE_SCREEN_SQUARE, $roomId);
    }

    public function getUserScreencap($uid) {
        $redis = $this->getRedis("live");

        return $redis->hGet(self::KEY_OF_USER_SCREEN_PIC, $uid);
    }

    public function getUserScreencapSquare($uid) {
        $redis = $this->getRedis("live");

        return $redis->hGet(self::KEY_OF_USER_SCREEN_SQUARE, $uid);
    }
}

?>
